import request from '@/utils/request'
const BASE_URL = '/pdd'

/**
 * 获取PDD用户信息
 * @returns {*}
 */
export function getPddUserInfo() {
  return request({
    baseURL: BASE_URL,
    url: '/bg/quiet/api/mms/userInfo',
    method: 'post'
  })
}

/**
 * 查询所有备货单
 * @param data
 * @returns {*}
 */
export function getAllSubOrderList(data) {
  return request({
    baseURL: BASE_URL,
    url: '/oms/bg/venom/api/supplier/purchase/manager/querySubOrderList',
    method: 'post',
    data
  })
}

/**
 * 销售数据
 * @param data
 * @returns {*}
 */
export function getSalesList(data) {
  return request({
    baseURL: BASE_URL,
    url: '/marvel-mms/cn/api/kiana/venom/sales/management/list',
    method: 'post',
    data
  })
}

/**
 * sku销售数据 月份
 * @param data
 * @returns {*}
 */
export function getSkuSaleNum(data) {
  return request({
    baseURL: BASE_URL,
    url: '/oms/bg/venom/api/supplier/sales/management/querySkuSalesNumber',
    method: 'post',
    data
  })
}

export function getAllProductList(data) {
  return request({
    baseURL: BASE_URL,
    url: '/deliveryOrder/getAllProductList',
    method: 'post',
    data
  })
}


/**
 * 新增库存
 */
export function addInventoryItemApi(data) {
  return request({
    baseURL: '/serv',
    url: '/api/addInventoryItem',
    method: 'post',
    data
  })
}
/**
 * 编辑库存
 */
export function updateInventoryItemApi(data) {
  return request({
    baseURL: '/serv',
    url: '/api/modifyInventoryItem',
    method: 'post',
    data
  })
}

/**
 * 删除库存
 */
export function deleteInventoryItemApi(data) {
  return request({
    baseURL: '/serv',
    url: '/api/delInventoryItem',
    method: 'post',
    data
  })
}
/**
 * 增加库存数
 */
export function addInventoryNumApi(data) {
  return request({
    baseURL: '/serv',
    url: '/api/addInventoryItemNum',
    method: 'post',
    data
  })
}
/**
 * 覆盖库存数
 */
export function resetInventoryNumApi(data) {
  return request({
    baseURL: '/serv',
    url: '/api/setInventoryItemNum',
    method: 'post',
    data
  })
}
/**
 * 查询库存
 */
export function getInventoryListApi(data) {
  return request({
    baseURL: '/serv',
    url: '/api/queryInventoryItemInfo',
    method: 'POST',
    data
  })
}
/**
 * 新增地址
 */
export function addAddressApi(data) {
  return request({
    baseURL:'/serv',
    url: '/api/addInventoryAddress',
    method: 'post',
    data
  })
}
/**
 * 删除地址
 */
export function deleteAddressApi(data) {
  return request({
    baseURL:'/serv',
    url: '/api/delInventoryAddress',
    method: 'post',
    data
  })
}
/**
 * 编辑地址
 */
export function updateAddressApi(data) {
  return request({
    baseURL: '/serv',
    url: '/api/modifyInventoryAddress',
    method: 'post',
    data
  })
}
/**
 * 查询地址
 */
export function getAddressApi(data) {
  return request({
    baseURL: '/serv',
    url: '/api/queryInventoryAddress',
    method: 'post',
    data
  })
}
/**
 * 查询出入库明细
 */
export function getInventoryDetailApi(data) {
  return request({
    baseURL: '/serv',
    url: '/api/queryInventoryItemOperationHistoryInfo',
    method: 'post',
    data
  })
}
/**
 * 获取vim库存
 */
export function getVMIDataApi(data) {
  return request({
    url: '/api/getTemuInventoryInfo',
    method: 'post',
    data
  })
}
